package com.example.sm_project01;


import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockActivity;
import com.example.sm_project01.DBHelper;
import android.os.Bundle;
import android.app.Activity;
import android.telephony.SmsManager;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import android.content.Intent;

public class MainActivity extends SherlockActivity {

	
	public static final int REQUEST_CODE_SMSSENDING=1001;
	public static final int REQUEST_CODE_SMSSETTING=2001;
	
	DBHelper mHelper;
	SQLiteDatabase db;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

	
		if(getSupportActionBar()!=null){
			ActionBar bar = getSupportActionBar();
			//for color
			bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#005BBB")));
			//for image
			//bar.setBackgroundDrawable(getResources().getDrawable(R.drawable.settings_icon));
		}

		/*mHelper = new DBHelper(getBaseContext());
		db = mHelper.getWritableDatabase();
		db.execSQL("DELETE FROM sms;");
		db.execSQL("DELETE FROM mail;");
		mHelper.close();*/	
		
		
	Button btnSMS = (Button)findViewById(R.id.btn_message);
	btnSMS.setOnClickListener(new Button.OnClickListener() {
		public void onClick(View v){
			Intent intent = new Intent(MainActivity.this, Sms_sending.class);
			startActivityForResult(intent, REQUEST_CODE_SMSSENDING);
			//startActivity(intent);
		}
	});
	
	Button btnSETTING = (Button)findViewById(R.id.btn_favorite);
	btnSETTING.setOnClickListener(new Button.OnClickListener() {
		public void onClick(View v){
			Intent intent = new Intent(MainActivity.this, Sms_setting_form.class);
			startActivity(intent);
			finish();
		}
	});

	}
		
}


